<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="lijun; 67086071; zwlijun@qq.com" />
<title>RIA Client API - BY 小网</title>
<link href="css/api.css" type="text/css" rel="stylesheet" />
</head>

<body>
  <ins>此文档描述Validator对象的方法及属性</ins>
  <div class="nav">
    <a href="#Validator">Validator()</a>
    <a href="#addItem">addItem()</a>
    <a href="#removeItem">removeItem()</a>
    <a href="#removeAllItem">removeAllItem()</a>
    <a href="#validate">validate()</a>
  </div>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">Validator构造方法<a name="Validator"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>构造函数</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var v = new Validator();</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>构造函数</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var v = new Validator();
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">addItem方法<a name="addItem"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>添加验证项</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>v.addItem(item)</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>添加验证项</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
v.addItem("usrname", "用户名", v.Types.FILTER, false, 3, 16);
v.addItem("passwd", "密码", v.Types.NULL, false, 6, 16);
v.addItem("annexcode", "验证码", v.Types.ENUM, false, 4, 4);  
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">removeItem方法<a name="removeItem"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>移除验证项</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>v.removeItem(itemId)</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>移除验证项</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
v.removeItem("usrname");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">removeAllItem方法<a name="removeAllItem"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>移除所有验证项</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>v.removeAllItem()</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>移除所有验证项</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
v.removeAllItem();
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">validate方法<a name="validate"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>校验</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var vValue = v.validate()</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>校验</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var isOK = v.validate();
</pre>
        </td>
      </tr>
    </tbody>
  </table>
</body>
</html>